//
//  ViewController.swift
//  SwiftFMDB
//
//  Created by 王冲 on 2018/5/5.
//  Copyright © 2018年 希艾欧科技有限公司. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
       
        self.view.backgroundColor = UIColor.green
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        
        
        deletePerson()
    }
    
    
    // MARK: 插入数据
    func insertPerson() {
        
        let person = Person(dict: ["name": "mm" as AnyObject ,"age": 90 as AnyObject])
        print(person.insertPerson())
    }
    
    // MARK: 插入数据（预编译插入数据）
    func insertPerson2() {
        
        let person = Person(dict: ["name": "王冲" as AnyObject ,"age": 30 as AnyObject])
        print(person.insertPerson2())
    }
    
    // MARK: 更新数据
    func updatePerson() {
        
        let person = Person(dict: ["name": "李银东" as AnyObject ,"age": 90 as AnyObject])
        print(person.updatePerson())
    }
    
    // MARK: 删除数据
    func deletePerson() {
        
        let person = Person(dict: ["name": "李银东" as AnyObject ,"age": 90 as AnyObject])
        print(person.deletePerson())
    }
    
    

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        
        
    }


}

